#include "Avalon/ServiceLocatorTests/MockServiceLocatorServerComponents.hpp"
#include "Avalon/IOTests/MockServerConnection.hpp"
#include "Avalon/Serialization/BinaryDataShuttleFactory.hpp"
#include "Avalon/ServiceLocator/ServiceLocatorServer.hpp"
#include "Avalon/ServiceLocatorTests/MockServiceLocatorDataStore.hpp"

using namespace Avalon;
using namespace Avalon::IO;
using namespace Avalon::IO::Tests;
using namespace Avalon::Serialization;
using namespace Avalon::ServiceLocator;
using namespace Avalon::ServiceLocator::Tests;
using namespace boost;
using namespace std;

MockServiceLocatorServerComponents::MockServiceLocatorServerComponents() {
  m_serverConnection = new MockServerConnection();
  m_dataStore = new MockServiceLocatorDataStore();
  m_server.reset(new ServiceLocatorServer(m_dataStore, m_serverConnection,
    new BinaryDataShuttleFactory()));
}

MockServiceLocatorServerComponents::~MockServiceLocatorServerComponents() {}

MockServerConnection&
    MockServiceLocatorServerComponents::GetServerConnection() {
  return *m_serverConnection;
}

MockServiceLocatorDataStore&
    MockServiceLocatorServerComponents::GetDataStore() {
  return *m_dataStore;
}

ServiceLocatorServer& MockServiceLocatorServerComponents::GetServer() {
  return *m_server;
}
